package great.project.param.config;

import great.project.param.config.convert.GenericBigDecimalConverter;
import great.project.param.config.convert.RequestParamsConvert;
import great.project.param.config.convert.StringToDateConverterFactory;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.lang.NonNull;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 *  <div  style="border:2px solid none;margin:20px;padding:15px;font-size:24px;text-align:center;color:aqua;">
 *
 *
 *
 *  </div>
 * @author v_zhangshun01
 * @date 2021/11/25 7:10 下午
 */
@Configuration
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer {

    @Override
    public void addFormatters(@NonNull FormatterRegistry registry) {
        registry.addConverter(new RequestParamsConvert());
        registry.addConverterFactory(new StringToDateConverterFactory());
        registry.addConverter(new GenericBigDecimalConverter());
    }


}
